package main

import (
	"project/PersonalBlog/controller"

	"github.com/gin-gonic/gin"
)

func main() {
	router := gin.Default()
	//加载静态文件
	router.Static("/static/", "./static")
	gin.SetMode(gin.ReleaseMode)
	//router.StaticFS("/static", http.Dir("D:/code/go/src/project/PersonalBlog/static"))
	//加载模板
	router.LoadHTMLGlob("views/*")

	router.GET("/", controller.IndexHandler)
	router.GET("/category/", controller.CategoryList)
	router.GET("/article/detail/", controller.ReadDetailHandler)
	router.GET("/article/new/", controller.EditorArticle)
	router.GET("/about/me/", controller.AboutMe)
	router.GET("/leave/new/", controller.ReadLeaves)

	router.POST("/comment/submit/", controller.PublishedComment)
	router.POST("/article/submit/", controller.PublishedArticle)
	router.POST("/leave/submit/", controller.PublishedLeavel)

	router.Run(":8000")
}
